-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add EIP: HASCODE instruction #8838
Conversation
✅ All reviewers have approved. |
EIPS/eip-is-contract.md
Outdated
|
||
## Abstract | ||
|
||
Allow EOF contracts to discriminate between EOA (Externally Owned Accounts) and smart contract accounts by introducing an `IS_CONTRACT` instruction. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allow EOF contracts to discriminate between EOA (Externally Owned Accounts) and smart contract accounts by introducing an `IS_CONTRACT` instruction. | |
Allow EOF contracts to discriminate between EOA (Externally Owned Accounts) and contracts (including smart contract accounts) by introducing an `IS_CONTRACT` instruction. |
ERC-721/1155 transfer checks are required for contracts, irrespective of whether they are contract accounts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abcoathup Actually, we'd like a clarification of your suggestion. "smart contract accounts" was a mental shortcut intending to mean "EVM state accounts with code", and probably that wording is clearer and more specific. Next, maybe we change "smart contract accounts" to "smart contract wallets" to avoid confusion. Would this work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what I have in mind: 2be26b3 - I think "contract account" is a well established and simple term, hope this works.
Co-authored-by: Andrew B Coathup <28278242+abcoathup@users.noreply.github.com>
The commit 17ac984 (as a parent of 7458c67) contains errors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would address my concerns and I would love to see it adopted.
EIPS/eip-7761.md
Outdated
|
||
### Keep code introspection banned | ||
|
||
Removing code introspection is one of the tenets of EOF and `IS_CONTRACT` would be an exception from the principle. Without `IS_CONTRACT`, ERC-721 and ERC-1155 standard implementations have to resort to either: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that the purpose of removing code introspection is to enable future semantics-preserving transformations of code already deployed on chain. In this sense IS_CONTRACT
would not be an obstacle at all, so I think it's debatable whether it would be an exception to that principle.
I think we should consider naming this opcode
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm seeing all issues have been addressed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All Reviewers Have Approved; Performing Automatic Merge...
Allow EOF contracts to discriminate between EOA (Externally Owned Accounts) and smart contract accounts by introducing an
IS_CONTRACT
instruction.This EIP responds to a community request to keep a way to distinguish between EOA and smart contract accounts in EOF, c.f. ACDE #195